home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 224 / 224.d81 / b.dir to bas (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  2KB  |  86 lines

  1. 5 ifpeek(56)<>64thenpoke56,64:run
  2. 10 d=peek(186):ifd<8thenstop
  3. 15 gosub1000
  4. 20 deffnh(x)=int(x/256)
  5. 21 deffnl(x)=x-fnh(x)*256
  6. 100 rem make a$ a moveable string
  7. 101 a$=str$(peek(71)+256*peek(72))
  8. 102 a=val(a$)
  9. 103 rem a holds length, a+1 holds lo
  10. 104 rem a+2 holds hi
  11. 105 :
  12. 110 f$="l/d.":f=len(f$)+1:rem find string
  13. 120 t$="ld.":t=len(t$)+1:rem to string
  14. 121 :
  15. 149 rem bload directory
  16. 150 sys57812"$:"+f$+"*",d,0:poke780,0:poke781,0:poke782,64 :sys65493
  17. 151 :
  18. 159 rem begin at 64*256 & skip header
  19. 160 l=64*256+32
  20. 161 l1=2       :rem skip 2 bytes
  21. 162 l2=16      :rem length of filename
  22. 163 rem check for "block" -- end of dir
  23. 164 pokea,5:pokea+1,fnl(l+l1):pokea+2,fnh(l+l1):ifa$="block"then900
  24. 169 rem find first quote marks
  25. 170 ifpeek(l+l1)<>34thenl1=l1+1:goto170
  26. 175 l1=l1+1
  27. 179 rem find length to 2nd quote marks
  28. 180 ifpeek(l+l1+l2)<>34thenl2=l2-1:goto180
  29. 189 rem poke len, lo, hi into a
  30. 190 pokea,l2:pokea+1,fnl(l+l1):pokea+2,fnh(l+l1)
  31. 191 rem scrub off prefix
  32. 192 a$=mid$(a$,f):printa$
  33. 193 rem rename to new prefix
  34. 194 open15,d,15,"r0:"+t$+a$+"="+f$+a$:close15
  35. 198 rem add 32 to location
  36. 199 l=l+32:goto161
  37. 900 d=dv:goto40000
  38. 999 end
  39. 1000 poke53280,0:poke53281,0:poke646,0:print"[147]"
  40. 1010 k=0:forx=8to15
  41. 1020 close2:open2,x,2:close2
  42. 1030 ifst=0thenk=k+1:dv(k)=x
  43. 1040 next
  44. 1050 poke214,10-k/2:print:printtab(05)"[208]lace [204]etter [196]rop [215]riter [196]isk
  45. 1051 [153][163]06)"in drive, and choose device:
  46. 1052 print:mu=peek(214)-1:gosub2000
  47. 1053 forx=1tok:printtab(13)x;"[157] [196]rive"dv(x):next
  48. 1054 printtab(13)x;"[157] [197]xit "
  49. 1060 gosub1100
  50. 1070 poke198,0:wait198,1:getz$
  51. 1071 ifz$=""then1200
  52. 1072 ifz$="[145]"then1210
  53. 1073 ifz$=chr$(13)thenz=mm+1:goto1221
  54. 1074 z=val(z$):ifz>0andz<k+2then1220
  55. 1075 goto1070
  56. 1100 poke214,mu+om:print
  57. 1101 ifom=kthenprinttab(13)"[146]"k+1"[157] [197]xit ":goto1110
  58. 1102 printtab(13)"[146]"om+1"[157] [196]rive"dv(om+1)"[157] "
  59. 1110 poke214,mu+mm:print
  60. 1111 ifmm=kthenprinttab(13)""k+1"[157] [197]xit ":return
  61. 1112 printtab(13)""mm+1"[157] [196]rive"dv(mm+1)"[157] "
  62. 1120 return
  63. 1200 om=mm:mm=mm+1:ifmm+1>k+1thenmm=0
  64. 1201 goto1060
  65. 1210 om=mm:mm=mm-1:ifmm<0thenmm=k
  66. 1211 goto1060
  67. 1220 om=mm:mm=z-1:gosub1100
  68. 1221 ifmm=kthen40000
  69. 1222 dv=d:d=dv(z):return
  70. 2000 mm=0:forx=1tok:ifd=dv(k)thenmm=x-1
  71. 2001 next:om=mm:return
  72. 9999 end
  73. 10000 d=peek(186):n$="b.dir to bas":open1,d,15,"i0":close1
  74. 10001 open1,d,15,"s0:"+n$:close1:saven$,d:end
  75. 10008 poke186,8:goto10000
  76. 40000 fori=0to21:poke828+i,8+i:next
  77. 40010 ifdv<8ordv>29ordv=8then40030
  78. 40020 a=peek(828):b=peek(828+dv-8):poke828,b:poke828+dv-8,a
  79. 40030 a$="hello connect":forj=8to29:i=peek(828+j-8):ifi=14thennext
  80. 40040 close2:open2,i,2:close2:ifstthen40060
  81. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  82. 40060 next:print"[147]":poke53272,23:poke186,8:end
  83. 40070 q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  84. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  85. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  86.